package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="auto_supplier" )
public class AutoSupplier extends BaseObject implements Serializable {
    private Long spId;
    private String domain;
    private boolean newOn;
    private byte status;
    private String supplierBriefName;
    private Long supplierId;
    private String supplierPline;
    private Long syncTime;
    private Long syncTimeForPlat;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getSpId() {
        return this.spId;
    }
    
    public void setSpId(Long spId) {
        this.spId = spId;
    }
    
    @Column(name="domain", nullable=false)
    public String getDomain() {
        return this.domain;
    }
    
    public void setDomain(String domain) {
        this.domain = domain;
    }
    
    @Column(name="new_on", nullable=false)
    public boolean isNewOn() {
        return this.newOn;
    }
    
    public void setNewOn(boolean newOn) {
        this.newOn = newOn;
    }
    
    @Column(name="status", nullable=false)
    public byte getStatus() {
        return this.status;
    }
    
    public void setStatus(byte status) {
        this.status = status;
    }
    
    @Column(name="supplier_brief_name", nullable=false, length=30)
    public String getSupplierBriefName() {
        return this.supplierBriefName;
    }
    
    public void setSupplierBriefName(String supplierBriefName) {
        this.supplierBriefName = supplierBriefName;
    }
    
    @Column(name="supplier_id", nullable=false)
    public Long getSupplierId() {
        return this.supplierId;
    }
    
    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }
    
    @Column(name="supplier_pline", nullable=false)
    public String getSupplierPline() {
        return this.supplierPline;
    }
    
    public void setSupplierPline(String supplierPline) {
        this.supplierPline = supplierPline;
    }
    
    @Column(name="sync_time", nullable=false)
    public Long getSyncTime() {
        return this.syncTime;
    }
    
    public void setSyncTime(Long syncTime) {
        this.syncTime = syncTime;
    }
    
    @Column(name="sync_time_for_plat", nullable=false)
    public Long getSyncTimeForPlat() {
        return this.syncTimeForPlat;
    }
    
    public void setSyncTimeForPlat(Long syncTimeForPlat) {
        this.syncTimeForPlat = syncTimeForPlat;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AutoSupplier pojo = (AutoSupplier) o;

        if (domain != null ? !domain.equals(pojo.domain) : pojo.domain != null) return false;
        if (newOn != pojo.newOn) return false;
         if (supplierBriefName != null ? !supplierBriefName.equals(pojo.supplierBriefName) : pojo.supplierBriefName != null) return false;
        if (supplierId != null ? !supplierId.equals(pojo.supplierId) : pojo.supplierId != null) return false;
        if (supplierPline != null ? !supplierPline.equals(pojo.supplierPline) : pojo.supplierPline != null) return false;
        if (syncTime != null ? !syncTime.equals(pojo.syncTime) : pojo.syncTime != null) return false;
        if (syncTimeForPlat != null ? !syncTimeForPlat.equals(pojo.syncTimeForPlat) : pojo.syncTimeForPlat != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (domain != null ? domain.hashCode() : 0);
        result = 31 * result + (newOn ? 1 : 0);
         result = 31 * result + (supplierBriefName != null ? supplierBriefName.hashCode() : 0);
        result = 31 * result + (supplierId != null ? supplierId.hashCode() : 0);
        result = 31 * result + (supplierPline != null ? supplierPline.hashCode() : 0);
        result = 31 * result + (syncTime != null ? syncTime.hashCode() : 0);
        result = 31 * result + (syncTimeForPlat != null ? syncTimeForPlat.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("spId").append("='").append(getSpId()).append("', ");
        sb.append("domain").append("='").append(getDomain()).append("', ");
        sb.append("newOn").append("='").append(isNewOn()).append("', ");
        sb.append("status").append("='").append(getStatus()).append("', ");
        sb.append("supplierBriefName").append("='").append(getSupplierBriefName()).append("', ");
        sb.append("supplierId").append("='").append(getSupplierId()).append("', ");
        sb.append("supplierPline").append("='").append(getSupplierPline()).append("', ");
        sb.append("syncTime").append("='").append(getSyncTime()).append("', ");
        sb.append("syncTimeForPlat").append("='").append(getSyncTimeForPlat()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
